package com.dycs.service.impl;

import com.dycs.service.ReturnJsonCollectionByJsonString;
import com.dycs.utils.JsonCollectionByJsonString;
import com.dycs.utils.Result;
import com.dycs.utils.ResultUtil;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReturnJsonCollectionByJsonStringImpl implements ReturnJsonCollectionByJsonString {

    @Override
    public Result<String> getIntersection(List<String> list) {
        String str = JsonCollectionByJsonString.getIntersection(list);
        if (str == null) {
            return ResultUtil.error(500,"json字符串格式错误！");
        }else {
            return ResultUtil.success(str);
        }
    }
}
